import request from '@/utils/request'

// 商品列表
export async function getgoodspage(params) {
  const res = await request({
    url: '/Goods/getgoodspage',
    method: 'post',
    params
  })
  return res
}

// 商品类型列表
export async function getgoodstypepage(params) {
  const res = await request({
    url: '/Goods/getgoodstypepage',
    method: 'post',
    params
  })
  return res
}

// 新增编辑商品
export async function GoodsEdti(data) {
  try {
    const res = await request({
      url: '/Goods/GoodsEdti',
      method: 'post',
      data
    })
    return res
  } catch (error) {
    return null
  }
}

// 商品详情
export async function GoodsFirst(params) {
  const res = await request({
    url: '/Goods/GoodsFirst',
    method: 'post',
    params
  })
  return res
}

// 新增商品类型
export async function GoodstypeEdti(data) {
  const res = await request({
    url: '/Goods/GoodstypeEdti',
    method: 'post',
    data
  })
  return res
}

// 类型详情
export async function GoodstypeFirst(params) {
  const res = await request({
    url: '/Goods/GoodstypeFirst',
    method: 'post',
    params
  })
  return res
}

// 商品状态
export async function SetState(params) {
  const res = await request({
    url: '/Goods/SetState',
    method: 'post',
    params
  })
  return res
}

// 商品分类
export async function GoodstypeSetstate(params) {
  const res = await request({
    url: '/Goods/GoodstypeSetstate',
    method: 'post',
    params
  })
  return res
}

// 批量删除
export async function DeleteShopgoods(data) {
  const res = await request({
    url: '/Goods/Delete_shopgoods',
    method: 'post',
    data
  })
  return res
}

// 查看商品属性列表
export async function GetGoodsAttr(params) {
  const res = await request({
    url: '/Goods/GetGoodsAttr',
    method: 'post',
    params
  })
  return res
}

// 新增商品属性
export async function EditAttr(data) {
  const res = await request({
    url: '/Goods/EditAttr',
    method: 'post',
    data
  })
  return res
}

// 商品评论列表
export async function CommentByGoods(params) {
  const res = await request({
    url: '/Goods/CommentByGoods',
    method: 'post',
    params
  })
  return res
}

// 批量删除评论
export async function deleteComment(data) {
  const res = await request({
    url: '/Goods/deleteComment',
    method: 'post',
    data
  })
  return res
}

// 店铺列表
export async function MallShopPage(params) {
  const res = await request({
    url: '/Goods/MallShopPage',
    method: 'post',
    params
  })
  return res
}

// 单个店铺信息
export async function MallShopInfo(params) {
  const res = await request({
    url: '/Goods/MallShopInfo',
    method: 'post',
    params
  })
  return res
}

// 编辑店铺信息
export async function mallshopEdit(data) {
  const res = await request({
    url: '/Goods/mallshopEdit',
    method: 'post',
    data
  })
  return res
}

// 店铺审核
export async function SetMallState(params) {
  const res = await request({
    url: '/Goods/mallshopSetState',
    method: 'post',
    params
  })
  return res
}
